﻿@model Pro260Website.Models.ListingViewModel<Domain.Entity.Video>
@{
    ViewBag.Title = "Admin -- Videos";
}

<h2 class="title @Html.GetColor(Request.Cookies["color"])">Admin Video Listings</h2>
<div id="formBackground">

    <table style="text-align: center;" class="defaultGrey">
        <tr class="tHeader @Html.GetColor(Request.Cookies["color"])">
            <th>Original Name</th>
            <th>File System Name</th>
            <th></th>
        </tr>
        @foreach (var v in Model.Items)
        {
            if (v.VideoName != null)
            {
            <tr>
                <td>@v.OriginalName</td>
                <td>@v.VideoName</td>
                <td>
                    @using(Html.BeginForm("DeleteVideo", "Video")){
                     @Html.Hidden("VideoID", v.VideoID)
                     <input type="submit" value="Delete" class="actionButtons" />   
                    }
                </td>
            </tr>
            }
        }
    </table>
    <br /><br />

    @Html.ActionLink("Upload Video", "UploadVideo", "Video")

    <div id="pagerForm" class="pager @Html.GetColor(Request.Cookies["color"])">
        @Html.PageLinks(Model.PagingInfo, i => Url.Action("AdminListings", "Video", new {page = i, pageSize = Model.PagingInfo.ItemsPerPage }))
    </div>
</div>